import Vue from 'vue'
import Router from 'vue-router'
// import login from '@/components/login'
// import index from '@/components/index'
const login = () => import('@/components/login')
const index = () => import('@/components/index')
const addUser = () => import('@/components/addUser')
const userList = () => import('@/components/userList')
const updateUser = () => import('@/components/updateUser')
const textList = () => import('@/components/textList')
const productList = () => import('@/components/product/productList')
const addProduct = () => import('@/components/product/addProduct')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/',
      name: 'index',
      component: index,
      children: [
        {
          path: '/updateUser',
          name: 'updateUser',
          component: updateUser
        },
        {
          path: '/userList',
          name: 'userList',
          component: userList
        },
        {
          path: '/addUser',
          name: 'addUser',
          component: addUser
        },
        {
          path: '/productList',
          name: 'productList',
          component: productList
        },
        {
          path: '/addProduct',
          name: 'addProduct',
          component: addProduct
        }
      ]
    },
  ]
})
